<include file="Public/head" />
<script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
<body>
<script>
    var ue = UE.getEditor('editor');
</script>
<div class="panel admin-panel">
  <!--<div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>-->
  <div class="body-content">
    <form method="post" class="form-x" action="?" enctype="multipart/form-data">
      <div class="form-group">
        <div class="label">
          <label>用户名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$info['account_name']}" name="account_name" data-validate="required:请输入用户名" />
          <div class="tips"></div>
        </div>
      </div>
        <div class="form-group">
            <div class="label">
                <label>密码：</label>
            </div>
            <div class="field">
                <input type="password" class="input w50" value="" name="password" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>公司名称：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="{$info['company_name']}" name="company_name" data-validate="required:请输入公司名称!" />
                <div class="tips"></div>
            </div>
        </div>
         <div class="form-group">
          <div class="label">
            <label>logo：</label>
          </div>
          <div class="field">
            <input type="file" class="button bg-blue" name="company_logo" value="+ {:L('liulanshangchuan')}" onchange="preview(this)" style="float: left;">
            <div id="preview" name="img" style="float: left;width: 10%;box-sizing: border-box;" class="input" >
              <empty name="info['company_logo']">
                <img src="__PUBLIC__/images/zanwu.jpg" width="100%" />
                <else />
                <img src="__ROOT__/{$info['company_logo']}" width="100%" />
              </empty>
            </div>
            <div class="tipss">推荐尺寸：100*100</div>
          </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>联系人：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="{$info['full_name']}" name="full_name" data-validate="required:请输入联系人名字!" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>手机号：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="{$info['tel']}" name="tel" data-validate="required:请输入电话号码!" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>套餐：</label>
          </div>
          <div class="field">
            <select name="role_id" class="input w50">
                <option value="0">请选择</option>
                <foreach name="package" item="v">
                    <option value="{$v['role_id']}" <if condition="$v['role_id'] eq $info['role_id']">selected="selected"</if>>{$v['role_name']}</option>
                </foreach>
            </select>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>有效期</label>
            </div>
            <div class="field">
                <input class="Wdate input w50" type="text" name="expire_time" value="{$info['expire_time']|date="Y-m-d",###}" onClick="WdatePicker()" />
            </div>
        </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
    function preview(file)
    {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="100%" />';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
</script>
</body>
</html>